#ifndef STM32F4xx_ETH_BSP_H_
#define STM32F4xx_ETH_BSP_H_

#include "netif.h"
#include "stm32f4xx.h"
#include "stm32f4xx_HAL_gpio.h"

extern struct netif xnetif;
extern __IO uint32_t  EthStatus;

#define ETH_LINK_PIN					GPIO_PIN_4
#define ETH_LINK_GPIO_PORT           	GPIOA

#define ETH_RESET_PHY_PORT				GPIOB
#define ETH_RESET_PHY_PIN				GPIO_PIN_0

#define ETH_RMII_REF_CLK_PORT			GPIOA
#define ETH_RMII_REF_CLK_PIN			GPIO_PIN_1

#define ETH_MDIO_PORT 					GPIOA
#define ETH_MDIO_PIN					GPIO_PIN_2

#define ETH_RMII_CRS_DV_PORT			GPIOA
#define ETH_RMII_CRS_DV_PIN				GPIO_PIN_7

#define ETH_MDC_PORT					GPIOC
#define ETH_MDC_PIN						GPIO_PIN_1

#define ETH_RMII_RXD0_PORT				GPIOC
#define ETH_RMII_RXD0_PIN				GPIO_PIN_4

#define ETH_RMII_RXD1_PORT				GPIOC
#define ETH_RMII_RXD1_PIN				GPIO_PIN_5

#define ETH_RMII_TX_EN_PORT				GPIOB
#define ETH_RMII_TX_EN_PIN				GPIO_PIN_11

#define ETH_RMII_TXD0_PORT				GPIOB
#define ETH_RMII_TXD0_PIN				GPIO_PIN_12

#define ETH_RMII_TXD1_PORT				GPIOB
#define ETH_RMII_TXD1_PIN				GPIO_PIN_13

/* Ethernet Flags for EthStatus variable */
#define ETH_INIT_FLAG           0x01 /* Ethernet Init Flag */
#define ETH_LINK_FLAG           0x10 /* Ethernet Link Flag */
//
///* Exported macro ------------------------------------------------------------*/
///* Exported functions ------------------------------------------------------- */
void  ETH_BSP_Config(void);
uint32_t Eth_Link_PHYITConfig(uint16_t PHYAddress);
void Eth_Link_ITHandler(uint16_t PHYAddress);
void ETH_link_callback(struct netif *netif);
void Eth_Link_IT_task( void * pvParameters );
#endif /* __STM32F4x7_ETH_BSP_H */


/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

